package com.xing.binbackend.pattern.factory12.opensource.beanfactory;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

// spring-beans/src/main/java/org/springframework/beans/factory/support
// /DefaultListableBeanFactory.java
//2. 默认实现类（具体工厂）
public class DefaultListableBeanFactory implements BeanFactory {

    // 核心存储结构：Bean定义注册表
    private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>(256);

    // 实现工厂方法
    @Override
    public Object getBean(String name) throws BeansException {
        return null;
    }

    @Override
    public <T> T getBean(String name, Class<T> requiredType) throws BeansException {
        return null;
    }


    @Override
    public <T> T getBean(Class<T> requiredType) throws BeansException {
        return null;
//        return getBeanProvider(requiredType).getIfAvailable();
    }
}
